package algorytm;

import java.util.LinkedList;
import java.util.Random;

import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.UndirectedSparseGraph;

public class Algorythm 
{
	Population p;
	Graph<Integer, Integer> g=new UndirectedSparseGraph<Integer, Integer>();
	int maxCliqueSize;
	int additionalEdges;
	int additionalVertexes;
	int populationSize;
	
	public void createGraph()
	{
		for (int i=0; i<additionalVertexes+maxCliqueSize; ++i)
		{
			g.addVertex(i);
		}
		int edgeNumber=0;
		
		for (int i=0; i<maxCliqueSize; ++i)
		{
			for (int j=0; j<maxCliqueSize; ++j)
			{
				if (i<j)
				{
					g.addEdge(edgeNumber, i, j);
					++edgeNumber;
				}
			}
		}
		
		Random r=new Random();
		
		for (int i=0; i<additionalVertexes || i<additionalEdges; ++i)
		{
			if (i<additionalVertexes)
			{
				int v=r.nextInt(maxCliqueSize+i);
				g.addEdge(edgeNumber, i+maxCliqueSize, v);
				++edgeNumber;
			}
			else
			{
				int v1=r.nextInt(maxCliqueSize+additionalVertexes);
				int v2=r.nextInt(maxCliqueSize+additionalVertexes);
				while (v1==v2)
					v2=r.nextInt(maxCliqueSize+additionalVertexes);
				g.addEdge(edgeNumber, v1, v2);
				++edgeNumber;
			}
		}
	}
		
	
}
